﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SpriteMover : MonoBehaviour
{
    public float jumpPos = -30f;
    public float moveSpeed = -3f;
    //public float heightOffset = 0f;
    //public float totalHeight;

    //private void Start()
    //{
    //    totalHeight = (EnumBase.playerMaxY - EnumBase.playerMinY);
    //}

    void Update()
    {
        Vector3 pos = this.transform.position + Vector3.right * moveSpeed * Time.deltaTime;

        //float avgPlayerHeight;
        //if (PlayerController.Instance.bCanControlPlayer2)
        //{
        //    avgPlayerHeight = (LevelManager.Instance.player1.transform.position.y + LevelManager.Instance.player2.transform.position.y) * 0.5f;
        //}
        //else
        //{
        //    avgPlayerHeight = LevelManager.Instance.player1.transform.position.y;
        //}
        //float y = (avgPlayerHeight / totalHeight - 0.5f) * heightOffset;

        pos = new Vector3(pos.x % jumpPos, pos.y, pos.z);
        this.transform.position = pos;
    }
}
